#cs ----------------------------------------------------------------------------
	
	$Author: bjoern.kaiser $
	$LastChangedDate: 2008-05-02 13:09:41 +0000 (Fri, 02 May 2008) $
	
	Script Function:
	7-zip wrapper
	
#ce ----------------------------------------------------------------------------

#include-once

#CS
	Unpack and rename (if neccessary) the files
#CE

Func _7z_HalUnpack($strTarget, $strCabFile, $strTgtFile = 0)
	Local $intRc
	Local $strWinDir = $strTarget & "\Windows"
	Local $strSystem32 = $strWinDir & "\System32"
	Local $strCmd = $gStrSourceDrv & '\bin\7za.exe x -y -o' & $strSystem32 & ' "' & $strWinDir & '\Driver Cache\i386\sp' & _
			_ini("OS", "SPLEVEL") & '.cab" ' & $strCabFile
	_log("I", "Unpacking:" & @CRLF & $strCabFile)
	
	If Not $gBinTest Then
		If Not $gBinDebug Then
			RunWait($strCmd, "", @SW_HIDE)
		Else
			RunWait($strCmd)
		EndIf
		
		If $strTgtFile Then
			$intRc = FileMove($strSystem32 & "\" & $strCabFile, $strSystem32 & "\" & $strTgtFile, 1)
			_log("D", "Renaming:" & @CRLF & $strSystem32 & "\" & $strCabFile & _
					"," & $strSystem32 & "\" & $strTgtFile & @CRLF & "RC: " & $intRc)
		EndIf
	Else
		_log("I", $strCmd)
		If $strTgtFile Then _log("I", "FileMove: " & $strSystem32 & "\" & $strCabFile & " >>> " & $strSystem32 & "\" & $strTgtFile)
	EndIf
	
EndFunc   ;==>_7z_HalUnpack

Func _7z_Unpack($strFile, $strFolder)
	Local $strCmd = $gStrSourceDrv & '\bin\7za.exe x -o' & $strFolder & $strFile
	If Not $gBinTest Then
		RunWait($strCmd)
	Else
		_log("I", $strCmd)
	EndIf
EndFunc   ;==>_7z_Unpack